package com.mzy.tomcat;

import com.mzy.tomcat.handler.MzyRequestHandler;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class MzyTomcatV1 {

    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8080);
        System.out.println("============8080端口监听中============");
        while (!serverSocket.isClosed()) {
            Socket socket = serverSocket.accept();
            new Thread(new MzyRequestHandler(socket)).start();
        }
        serverSocket.close();

    }
}
